//
//  UIView+category.m
//  LGFCategory
//
//  Created by lee on 2018/8/10.
//  Copyright © 2018年 lee. All rights reserved.
//

#import "UIView+category.h"


@implementation UIView (category)

- (void)setX:(CGFloat)x
{
    CGRect frame = self.frame;
    frame.origin.x = x;
    self.frame = frame;
}

- (CGFloat)x
{
    return self.frame.origin.x;
}

- (void)setY:(CGFloat)y
{
    CGRect frame = self.frame;
    frame.origin.y = y;
    self.frame = frame;
}

- (CGFloat)y
{
    return self.frame.origin.y;
}

- (void)setWidth:(CGFloat)width
{
    CGRect frame = self.frame;
    frame.size.width = width;
    self.frame = frame;
}
- (CGFloat)width
{
    return self.frame.size.width;
}

- (void)setHeight:(CGFloat)height
{
    CGRect frame = self.frame;
    frame.size.height = height;
    self.frame = frame;
}

- (CGFloat)height
{
    return self.frame.size.height;
}

- (void)setSize:(CGSize)size
{
    CGRect frame = self.frame;
    frame.size = size;
    self.frame = frame;
}

- (CGSize)size
{
    return self.frame.size;
}

- (void)setOrigin:(CGPoint)origin
{
    CGRect frame = self.frame;
    frame.origin = origin;
    self.frame = frame;
}

- (CGPoint)origin
{
    return self.frame.origin;
}


#pragma mark--添加底部阴影
-(void)addBottomShadowWithColor:(UIColor *)color
{
    [self addShadowWithColor:color];
    self.layer.shadowOffset=CGSizeMake(0, 5);
}

#pragma mark--添加阴影效果
-(void)addShadowWithColor:(UIColor *)color
{
    self.layer.shadowColor=color.CGColor;
    self.layer.shadowOpacity=0.9;
    self.layer.shadowOffset=CGSizeMake(0, 0);
    self.layer.shadowRadius=4;
}



@end
